gusucode.com > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM源码程序 > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM\stprtool\datasets\xi2file.m

    function [] = xi2file(X,I,fname)
% [] = xi2file(X,I,fname)
%
% XI2FILE saves finite point set with their labels to a file
%    in an internal data format used in the toolbox. For more details
%    on the toolbox data formats refer to HTML documentation.
%
% Input:
%  X [NxK] contains point set which is to be stored.
%  I [1xK] contains labels for each point. The labels have to be
%     integers.
%  fname [string]
%
% See also DATASETS.
%
% Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac
% (c) Czech Technical University Prague, http://cmp.felk.cvut.cz
% Written Vojtech Franc (diploma thesis) 02.01.2000
% Modifications

maxi=max(I);
mini=min(I);
K=[];
for i=mini:maxi,
   k=length(find(I==i));
   if length(find(I==i))~=0,
      K=[K,k];
   end
end

id=dataid(1);  % takes identifier for finite point sets data type

N=size(X,1);   % takes dimension of feture space

save(fname,'id','X','I','N','K');

return;